//
//  HomeViewController.m
//  DuoDian
//
//  Created by 张卓 on 2017/8/16.
//  Copyright © 2017年 bigcastcloudShop. All rights reserved.
//

#import "HomeViewController.h"
#import "LoginViewController.h"
#import "QRcodeViewController.h"

@interface HomeViewController ()
@property (weak, nonatomic) IBOutlet UIButton *saoClickBtn;

@end

@implementation HomeViewController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = true;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
//    self.view.backgroundColor = [UIColor redColor];
    
    if (![[UserDefaultsManager shareUserDefaultsManager] isUserLoggedIn]) {
        LoginViewController *sbVC = [[UIStoryboard storyboardWithName:@"LoginViewController" bundle:nil] instantiateViewControllerWithIdentifier:@"Login"];
        UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:sbVC];
        [self presentViewController:nav animated:YES completion:nil];
    }
    
    self.saoClickBtn.layer.masksToBounds = YES;
    self.saoClickBtn.layer.cornerRadius = 5;
}
- (IBAction)SaoClickbtn:(id)sender {
    // 跳转扫一扫界面
//    QRcodeViewController *qRcodeVC = [[UIStoryboard storyboardWithName:@"HomeViewController" bundle:nil] instantiateViewControllerWithIdentifier:@"QR"];
    QRcodeViewController *qRcodeVC = [[QRcodeViewController alloc]init];
    [self.navigationController pushViewController:qRcodeVC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
